-
-
Notifications
You must be signed in to change notification settings - Fork 42
London | 25-SDC-Nov | Emiliano Uruena | Sprint 5 | Prep Exercises #306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This file is not necessary.
LonMcGregor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good work on these tasks, there are some areas where you could improve further
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not need to change files in other directories, is there a reason you changed this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you describe the difference and any dis/advantage of using a class method vs a function?
| def print_family_tree(person: Person) -> None: | ||
| print(person.name) | ||
| for child in person.children: | ||
| print(f"- {child.name} ({child.age})") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this print grandchildren recursively?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output here could be neater, it is generally not a good idea to print objects directly to user facing interfaces.
Good idea to allow using numbers for quicker data entry.
You might want to consider adding a bit more data validation in case the input is incorrect, e.g. if I type a letter instead of a number for age
Self checklist
Changelist
Completed all Sprint 5 prep exercises following the provided guide.
This includes: object-oriented programming concepts such as classes, inheritance, methods, dataclasses, enums, and generics.
Also worked through mypy type checking and type-guided refactoring to reinforce static typing and code quality.